package com.quanyan.stadium.enums.errorEnum;

/**
 * Created by xiaoxiao on 16/6/2.
 *
 * 赛事对战表编排出错错误信息
 */
public enum CreateCompListErrorEnum {


    CREATE_COMP_LIST_ERROR_1(1,"1001","赛事编排参数不能为空","赛事编排参数不能为空"),
    CREATE_COMP_LIST_ERROR_2(2,"1002","赛事编排的开始和结束时间不合法", "赛事编排的开始和结束时间不合法"),
    CREATE_COMP_LIST_ERROR_3(3,"1003","上一轮次积分录入存在异常,无法创建当前轮次对战表","上一轮次积分录入存在异常,无法创建当前轮次对战表"),
    CREATE_COMP_LIST_ERROR_4(4,"1004","上一轮积分录入异常,无法生存当前轮次对战表", "上一轮积分录入异常,无法生存当前轮次对战表"),
    CREATE_COMP_LIST_ERROR_5(5,"1005","参数问题,生成对战表失败","参数问题,生成对战表失败"),
    CREATE_COMP_LIST_ERROR_6(6,"1006","队伍数目不合法","当前没有报名队伍,无法创建对战表"),
    CREATE_COMP_LIST_ERROR_7(7,"1007","该赛事下没有轮次","无可用轮次,无法生成对战表"),
    CREATE_COMP_LIST_ERROR_8(8,"1008","当前轮次不存在","当前轮次不存在"),
    CREATE_COMP_LIST_ERROR_9(9,"1009","用户没有报名权限，或者已经报过名，不能报名","用户没有报名权限，或者已经报过名，不能报名"),
    CREATE_COMP_LIST_ERROR_10(10,"1010","当前轮次处于生成对战表阶段,不能重复生成","当前轮次处于生成对战表阶段,不能重复生成"),
    CREATE_COMP_LIST_ERROR_11(11,"1011","当前轮次积分录入存在异常,无法完结","当前轮次积分录入存在异常,无法完结"),
    CREATE_COMP_LIST_ERROR_12(12,"1012","报名人数不足,无法编排","报名人数不足,无法编排"),
    CREATE_COMP_LIST_ERROR_13(13,"1013","双打比赛报名人数必须为偶数","双打比赛报名人数必须为偶数");



    public static String getMsgById(int id){
        String msg = "未知错误";
        switch (id) {
            case 1:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_1.getLabel();
                break;
            case 2:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_2.getLabel();
                break;
            case 3:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_3.getLabel();
                break;
            case 4:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_4.getLabel();
                break;
            case 5:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_5.getLabel();
                break;
            case 6:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_6.getLabel();
                break;
            case 7:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_7.getLabel();
                break;
            case 8:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_8.getLabel();
                break;
            case 9:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_9.getLabel();
                break;
            case 10:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_10.getLabel();
                break;
            case 11:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_11.getLabel();
                break;
            case 12:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_12.getLabel();
                break;
            case 13:
                msg =CreateCompListErrorEnum.CREATE_COMP_LIST_ERROR_13.getLabel();
                break;
            default:
                break;
        }
        return msg;
    }

    CreateCompListErrorEnum(int id, String code, String name, String label) {
        this.id = id;
        this.code = code;
        this.name = name;
        this.label = label;
    }

    private int id;

    private String code;

    private String name;

    private String label;

    public Integer getId() {
        return id;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getLabel() {
        return label;
    }
}
